package ar.com.jwa.services;
import java.io.IOException;

import javax.mail.MessagingException;
import javax.mail.internet.AddressException;

import junit.framework.TestCase;
import ar.com.jwa.domain.Mail;


public class sendMailTestCase extends TestCase {

	public void testSendMail() throws IOException {
		
		Mail mail = new Mail();

		mail.setSubject("Soccer Weekly");
		
		mail.setText("<H1>Hello</H1>" + "<img src=\"cid:soccer\">");
		
//		mail.setTo("nicolas.hernan.gonzalez@gmail.com");
//		mail.setTo("hgonzalez@cubika.com");
		mail.setTo("ludmila.martinez@gmail.com");
		
		mail.setFrom("Soccer@Comunidad-Garmendia.com");
		
		mail.setHost("smtp.gmail.com");		
		
		mail.setProtocol("smtps");
		
		mail.setSmtpUser("nicolas.hernan.gonzalez@gmail.com");
		
		mail.setSmtpPassword("WANNABESEDEATED");
		
		try {
			
			mail.sendAsHtml();
		
		} catch (AddressException e) {
			e.printStackTrace();
			fail(e.toString());
		
		} catch (MessagingException e) {
			e.printStackTrace();
			fail(e.toString());
		}
	}

}
